function beginMatch(){
    var matchJson = {matchop:'国际米兰',result:'1:0'};
    window.MainActivity.beginMatch(JSON.stringify(matchJson));
}

function show_my_info() {
    show_tab('my');
    $("#my_uuid").html(pp_uid);
}

function show_tab(tab){
    g_ico_bar.addClass('hide');
    $(".panel").addClass('hide');
    g_main_ui.hide();
    $("#"+tab+"_panel").removeClass('hide').css({height:p_height});
    console.log('show_tab:'+tab+' as '+p_height);
}
function close_tab(){
    g_ico_bar.removeClass('hide');
    g_main_ui.show();
    $(".panel").addClass('hide');
}

function get_pp_uid() {
    var storage = window.localStorage;
    pp_uid = storage.getItem("pp_uid");
    if (pp_uid==undefined) {
        pp_uid=$.uuid();
        storage.setItem("pp_uid", pp_uid);
        console.log(pp_uid);
    }
    console.log(pp_uid);
}

function build_url(m,a,plus) {
    var real_plus = '';
    $.each(plus,function(index,val){
        real_plus = '&'+index+'='+val;
    });
    return site_url+'?m='+m+'&a='+a+real_plus;
}

function loading_base() {
    get_pp_uid();
    var url = build_url('init','index',{pp_uid:pp_uid});
    $.getJSON(url,{},function(json){
        g_ico_bar.removeClass('hide');
        g_main_ui.removeClass('hide');
    });
}

function app_init() {
    p_height = g_height - g_broatcast.height();
    loading_base();
}
$(function(){
    app_init();
});